package org.madmac.ip;

import org.wakeful.conn.Connection;
import org.wakeful.query.Query;

/**
 *
 * @author atila camurca
 */
public final class IpQuery {

   public static final String TABLE = Connection.getSchema().concat(Query.DOT).concat("ip");
   public static final String ALIAS = TABLE.concat(" ip");

   private IpQuery() {}

   public static String selectIpLivre() {
      StringBuilder builder = new StringBuilder();
      builder.append(Query.SELECT);
      builder.append("ip AS ip_livre");
      builder.append(Query.FROM);
      builder.append(IpQuery.TABLE);
      builder.append(Query.WHERE);
      builder.append("livre = 'true'");
      builder.append(Query.AND);
      builder.append("id_faixa_ip = ? LIMIT 1");
      return builder.toString();
   }
}
